// part1:C12:12.20:ex12.20.cpp
// read a file and store them to StrBlob.
#include <iostream>
#include <fstream>
#include "my_StrBlob.h"
using namespace std;

int main(int argc, char **argv)
{
    ifstream in(argv[1]);
    if (!in) 
    {
        cout << "failed open input file!" << endl;
        return -1;
    }

    StrBlob b;
    string word;
    while (getline(in, word))
    {
        b.push_back(word);
    }

    for (auto it = b.begin(); neq(it, b.end()); it.incr())
    {
        cout << it.deref() << endl;
    }

    return 0;
}
